package org.bjdp.katas.usewiremockforintegrationtesting;

import org.springframework.web.client.RestTemplate;

public class HttpPersonClient implements PersonClient {
    private final RestTemplate restTemplate;

    public HttpPersonClient(RestTemplate restTemplate) {
        this.restTemplate = restTemplate;
    }

    @Override
    public Person person(int id) {
        return this.restTemplate.getForObject("http://localhost:8081/person/{id}",
                Person.class, id);
    }
}
